#!/usr/bin/env python3

n = 100
sum = 0
counter = 1
while counter <= n:
    sum = sum + counter #sum用来保存counter的值
    counter += 1

print("1 到 %d 之和为: %d" % (n, sum))
print(f"1 到 {counter - 1} 之和为: {sum}")